package cn.zxcoder.entity.SystemManage;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author zx
 * @since 2023-05-12
 */
@TableName("role_right")
@ApiModel(value = "Right对象", description = "权限管理")
@Data
public class Right implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField(value = "right_name")
    @ApiModelProperty("权限名称")
    private String rightName;

    @TableField(value = "right_code")
    @ApiModelProperty("权限代码")
    private String rightCode;

    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @ApiModelProperty("修改时间")
    private Date editTime;

    @ApiModelProperty("修改用户")
    private String editUser;

    @ApiModelProperty("子菜单权限字符串")
    private String schildren;

    @TableField(exist = false)
    @ApiModelProperty("子菜单权限数组")
    private List<Right> children;

    @TableField(value = "menu_id")
    @ApiModelProperty("对应的菜单id")
    private Integer menuId;

    @TableField(value = "is_op")
    @ApiModelProperty("是否是操作权限")
    private boolean isOp;

    public boolean isOp() {
        return isOp;
    }

    public void setOp(boolean op) {
        isOp = op;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    public String getRightName() {
        return rightName;
    }

    public void setRightName(String rightName) {
        this.rightName = rightName;
    }
    public String getRightCode() {
        return rightCode;
    }

    public void setRightCode(String rightCode) {
        this.rightCode = rightCode;
    }
    public Date getEditTime() {
        return editTime;
    }

    public void setEditTime(Date editTime) {
        this.editTime = editTime;
    }
    public String getEditUser() {
        return editUser;
    }

    public void setEditUser(String editUser) {
        this.editUser = editUser;
    }

    @Override
    public String toString() {
        return "Right{" +
            "id=" + id +
            ", rightName=" + rightName +
            ", rightCode=" + rightCode +
            ", editTime=" + editTime +
            ", editUser=" + editUser +
        "}";
    }
}
